package util;

import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.http.HttpResponse;  
import org.apache.http.NameValuePair;  
import org.apache.http.client.entity.UrlEncodedFormEntity;  
import org.apache.http.client.methods.HttpPost;  
import org.apache.http.impl.client.DefaultHttpClient;  
import org.apache.http.message.BasicNameValuePair;  
import org.apache.http.util.EntityUtils;
import org.springframework.http.HttpMethod;

import com.alibaba.fastjson.JSON;  
import com.alibaba.fastjson.JSONObject;  
  
public class DwzUtil {  
      
    public static String  generateShortUrl(String url) throws Exception {  
          
        Map<String, String> map = new HashMap<String, String>();
        map.put("url", URLEncoder.encode(url, "utf-8"));
        String str = HttpClientUtils.sendHttpGet("http://suo.im/api.php?url=" + URLEncoder.encode(url, "utf-8"));
        System.out.println(str);
        return str;
    }  
      
}  
